$(function () {
    $("div[rel=small]").live("click", function () {
        var c = $(this);
        "1" == c.data("hasbig") ? (c.parent().hide(), c.parent().siblings().show()) : $.ajax({url:GUANGER.path + "/editor/fetchBaobei", type:"post", dataType:"json", data:{id:c.data("proid")}, success:function (a) {
            if (100 == a.code) {
                var i = a.baobei.id, g = "http://guang.com/baobei/" + i, d = a.baobei.name, d = 15 < $.guang.util.getStrLength(d) ? $.guang.util.substring4ChAndEn(d, 15) + "..." : d, j = a.baobei.pic, f = a.baobei.recommend, f = f ? 40 < f.length ? f.substring(0, 40) + "..." : f :
                    "", e = "";
                if (a.baobei.brandList && 0 < a.baobei.brandList.length) {
                    for (var e = e + "<p>品牌：", b = 0; b < a.baobei.brandList.length; b++)e += "<span>" + a.baobei.brandList[b].brandName + "</span>";
                    e += "</p>"
                }
                var h = "";
                if (a.baobei.tags && 0 < a.baobei.tags.length)for (b = 0; b < a.baobei.tags.length; b++)h += "<span>" + a.baobei.tags[b].tagKeyword + "</span>";
                b = a.baobei.summary.worthCount;
                a = '<div class="baobei-feeds-detail clearfix">' + ('<div class="baobei-pic" rel="big"><a href="javascript:;"><img src="' + j + '" alt="' + d + '" /></a><span>￥' +
                    a.baobei.priceMin / 100 + '</span></div><div class="baobei-text"><h4><a target="_blank" href="' + g + '">' + d + '</a></h4><div class="baobei-info"><p>' + f + "</p>" + e + "<p>标签(" + a.baobei.tagCount + ")\uff1a" + h + '</p></div><div class="clearfix mt15"><a class="ilike-n" rel="like" data-prourl="' + g + '" data-proimgsrc="' + j + '" data-proname="' + d + '" data-type="0" data-proid="' + i + '" href="javascript:;">\u559c\u6b22</a><div class="stat-box">鉴定(' + b + "/" + (b + a.baobei.summary.unworthCount) + ')<span class="mr5 ml5">|</span>评论(' +
                    a.baobei.commentNum + ')</div></div></div><a target="_blank" href="' + g + '" class="baobei-link"></a>') + "</div>";
                c.parent().after(a);
                c.parent().hide();
                c.data("hasbig", "1")
            }
        }})
    });
    $("div[rel=big]").live("click", function () {
        $(this).parent().hide();
        $(this).parent().siblings().show()
    })
});
